USE QUANLYGIAODUC
GO
CREATE PROCEDURE dbo.HOCPHANMO_add
@maKhoaHoc int,
@maMonHoc int,
@namHoc int,
@hocKy int
	/*
	(
	@parameter1 int = 5,
	@parameter2 datatype OUTPUT
	)
	*/
AS
begin
	insert into HOCPHANMO (MAKHOAHOC, MAMONHOC, NAMHOC, HOCKY, SLSVDK_DUKIEN)
	values (@MaKhoaHoc, @maMonHoc, @namHoc, @hocKy, '')
end
	/* SET NOCOUNT ON */
	RETURN
GO
CREATE PROCEDURE dbo.HOCPHANMO_fix_SLSVDK_DUKIEN
@slsvdk_dukien int,
@maKhoaHoc int,
@maMonHoc int,
@namHoc int,
@hocKy int
	/*
	(
	@parameter1 int = 5,
	@parameter2 datatype OUTPUT
	)
	*/
AS
begin
	update HOCPHANMO set SLSVDK_DUKIEN = @slsvdk_dukien
	where MAKHOAHOC = @maKhoaHoc and
			MAMONHOC = @maMonHoc and 
			NAMHOC = @namHoc and
			HOCKY = @hocKy
end
	/* SET NOCOUNT ON */
	RETURN
GO	
CREATE PROCEDURE dbo.HOCPHANMO_getallwithNamHoc_HocKy
@namHoc int,
@hocKy int
	/*
	(
	@parameter1 int = 5,
	@parameter2 datatype OUTPUT
	)
	*/
AS
select * from HOCPHANMO
where NAMHOC = @namHoc and HOCKY = @hocKy
	/* SET NOCOUNT ON */
	RETURN
GO
CREATE PROCEDURE dbo.KHOA_getall
	/*
	(
	@parameter1 int = 5,
	@parameter2 datatype OUTPUT
	)
	*/
AS
	/* SET NOCOUNT ON */
	select * from KHOA
	RETURN
GO
CREATE PROCEDURE dbo.KHOAHOC_getall
	/*
	(
	@parameter1 int = 5,
	@parameter2 datatype OUTPUT
	)
	*/
AS
	select * from KHOAHOC
	/* SET NOCOUNT ON */
	RETURN
GO
CREATE PROCEDURE dbo.LOP_add
@maHPMo int
	/*
	(
	@parameter1 int = 5,
	@parameter2 datatype OUTPUT
	)
	*/
AS
begin
	insert into LOP (MAPHONG, MAGIAOVIEN, MAHPMO, NGAYHOC, TIETBATDAU, TIETKETTHUC, SLSVDK_CHINHTHUC)
	values (null, null, @maHPMo, null, null, null, null);
end
	/* SET NOCOUNT ON */
	RETURN
GO
CREATE PROCEDURE dbo.MONHOC_getallwithMaKhoa
@MaKhoa int
	/*
	(
	@parameter1 int = 5,
	@parameter2 datatype OUTPUT
	)
	*/
AS
	select * from MONHOC where MAKHOA = @MaKhoa
	/* SET NOCOUNT ON */
	RETURN
GO
CREATE PROCEDURE dbo.LOP_getall
AS
	select * from LOP
	RETURN
GO